package com.yh.Iservice.impl;


import com.yh.Iservice.EmployeeService;
import com.yh.dao.EmployeeDao;
import com.yh.entity.Employee;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class EmployServiceImpl implements EmployeeService {

    @Autowired
    public EmployeeDao employeeDao;
    @Override
    public Employee empLogin(String ename, String epassword) {
        System.out.println("----"+ename+"----"+epassword);
        Employee employee=employeeDao.empLogin(ename,epassword);
        if(employee==null||employee.equals("")){
            employee=null;
            return employee;
        }else {
            if (!employee.getEpassword().equals(epassword)){
                employee=null;
            }
            return employee;
        }

    }
	@Override
	public List<Employee> finlist() {
		// TODO Auto-generated method stub
		return employeeDao.findlist();
	}
}
